<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h2>今天天气很{{ weather }}</h2>
        <button @click="changeWeather">切换天气</button>
    </div>
    <script src="../vuejs/vue.js"></script>
    <script>
        const vm = new Vue({
            el : "#app",
            data() {
                return {
                    weather : '凉爽'
                }
            },
            methods: {
                changeWeather(){
                    this.weather = this.weather === '凉爽' ? '炎热' : '凉爽'
                }
            },
        })
    </script>
</body>
</html>